#!/usr/bin/bash

selected=$(eval $2 get selected)


if [[ $selected == "_none" ]] || [[ $selected == "" ]]; then
  eval "$2 update selected=$1"
  selected=$(eval $2 get selected)
else
  hyprctl dispatch movetoworkspacesilent $3,address:$selected

  eval "$2 update selected=_none"
  selected=$(eval $2 get selected)
fi